<?php

include_once("includes/Database.php");
include_once ("objects/Result.php");

class AgendaDetailModel {

	//Get Agenda List By id
	public function getAgendaDetailByAgendaId($agendaId)
	{
		// create an instance of the Database class and call it $db
		$db = new Database();
		//connect database
		$db->connect();
		// do a query to retrieve multiple records
		$query = "SELECT agendaDetailId,placeName,agendaDetailDate,agendaDetailTimeStart,agendaDetailTimeEnd,agendaDetailDescription FROM agendaDetail INNER JOIN place ON agendaDetail.placeId = place.placeId WHERE agendaId = $agendaId";
		// query the database
		$db->select($query);
		// get result
		$results = $db->getResult();
		// disconect database
		$db->disconnect();
		//return result
		return $results;
	}
}

?>